<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>jquery</title>
</head>
<body>
    <p>jquery test 1</p>
    <p>jquery test 2</p>
    <p>jquery test 3</p>

    <div id="div1">
        <p>jquery test in div</p>
    </div>

    <script src="./jquery-1.8.3.min.js"></script>
    <script type="text/javascript">
       //插件扩展
       $.fn.getNodeName=function(){
           //this
           alert(this[0].nodeName)
       }
    
    </script>
    <script type="text/javascript">

        var $p=$('p')
        $p.getNodeName()
        
    </script>
</body>
</html>